package com.jyh.homework.homework2;

import java.util.ArrayList;

public class MainAPP {
    public static void main(String[] args) {
        //3
        ArrayList<Student> STUDENT_LIST=new ArrayList<>();
        //4,5
        STUDENT_LIST.add(new Student("it001","黄渤",1.72));
        STUDENT_LIST.add(new Student("it002","孙红雷",1.78));
        STUDENT_LIST.add(new Student("it003","章子怡",1.64));
        STUDENT_LIST.add(new Student("it004","杨颖",1.68));
        //6
        System.out.println("学号\t\t姓名\t\t身高");
        for (Student student : STUDENT_LIST) {
            System.out.println(student.getId()+"  "+student.getName()+"    "+student.getTall());
        }
        //7
        int size = STUDENT_LIST.size();
        System.out.println("集合大小= " + size);
        //8
        Student student = STUDENT_LIST.get(2);
        System.out.println("学号\t\t姓名\t\t身高");
        System.out.println("属性值为:" + student.getId()+" "+student.getName()+" "+student.getTall());
        //9,10
        STUDENT_LIST.remove(3);
        int size1 = STUDENT_LIST.size();
        System.out.println("size1 = " + size1);
        //11.将第一个对象替换为以下对象
        Student set = STUDENT_LIST.set(0, new Student("it005", "撒贝宁", 1.67));
        System.out.println("=================================================");
        //12
        Double tall1=1.70;
        for (Student student1 : STUDENT_LIST) {
            if (student1.getTall()>=tall1){
                System.out.println(student1.getId()+" "+student1.getName()+" "+student1.getTall());
            }
        }
        System.out.println("=================================================");
        //13
        for (Student student1 : STUDENT_LIST) {
            if (student1.getName().contains("孙")){
                System.out.println(student1.getId()+" "+student1.getName()+" "+student1.getTall());
            }
        }
    }
}
